package com.sks.bean.pojo;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonManagedReference;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.annotations.Where;

import com.sks.bean.uploadfile.UploadFile;

/**
 * Building entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@JsonSerialize()
@JsonIgnoreProperties(value={"hibernateLazyInitializer"})  
@Table(name = "building", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }) })
public class Building implements java.io.Serializable {

	// Fields
	public static String BUILDING_STATUS_NONE_PUBLISH = "nonePublish";
	
	public static String BUILDING_STATUS_PUBLISHED = "published";
	
	public static String BUILDING_STATUS_INVALIDATE = "invalidate";

	private Integer buildingId;
	private PropertyType propertyType;
	private Area area;
	private MetroStation metroStation;
	private String name;
	private String status;
	private Date createTime;
	private Date lastUpdateTime;
	private Date publishTime;
	private Integer developStatus;
	private String developer;
	private String address;
	private String mapInfo;
	private String advantage;
	private String intro;
	private Double space;
	private String buildStructure;
	private Double yearLimit;
	private Double afforest;
	private Double cubage;
	private Date beginDate;
	private Date finishDate;
	private Date sellDate;
	private Date occupancyDate;
	private String trafficInfo;
	private String floorInfo;
	private String deliverStandar;
	private Integer recommend;
	private String propertyCompany;
	private String propertyPrice;
	private Double planSpace;
	private Integer carNumber;
	private String carRentPrice;
	private String carSellPrice;
	private Integer sellSchedule;
	private String effectImg;
	private String actionImg;
	private String trafficImg;
	private String planImg;
	private String sellAddress;
	private String linkMan;
	private String mobile;
	private String sellTel;
	private String fax;
	private Integer hits;
	private String surround;
	private String administration;
	private String educate;
	private String trade;
	private String medical;
	private String financial;
	private String repast;
	private String other;
	//private BuildingPrice price;
	// private Set<BuildingPrice> buildingPrices = new
	// HashSet<BuildingPrice>(0);
	private Set<House> houses = new HashSet<House>(0);
	private List<UploadFile> pictures = new ArrayList<UploadFile>(0);
	private List<UploadFile> videos = new ArrayList<UploadFile>(0);
	private List<AuditHistory> auditHistory = new ArrayList<AuditHistory>(0);
	
	private Integer propertyTypeId;
	private Integer areaId;
	private Integer stationId;
	private Integer metroId;
	
	private Integer rent;//出租数量
	private Integer sale;//出售数量

	private Double avgRent;//平均出租价格
	private Double avgSale;//平均出售价格
	private Double lng;
	private Double lat;
	
	public Building() {
	}

	public Building(Integer buildingId, String name, String status,
			String developer, Date lastUpdateTime, Integer developStatus,
			Integer recommend, String address, String linkMan, String mobile,
			String intro, Area area) {
		this.buildingId = buildingId;
		this.name = name;
		this.status = status;
		this.developer = developer;
		this.lastUpdateTime = lastUpdateTime;
		this.developStatus = developStatus;
		this.recommend = recommend;
		this.address = address;
		this.linkMan = linkMan;
		this.mobile = mobile;
		this.intro = intro;
		this.setArea(area);
	}

	public Building(Integer buildingId, String name, String propertyCompany, String propertyPrice,
			Integer carNumber, String carRentPrice, String carSellPrice, String status, Date lastUpdateTime,
			Integer developStatus, Date createTime, PropertyType propertyType) {
		this.buildingId = buildingId;
		this.name = name;
		this.propertyCompany = propertyCompany;
		this.propertyPrice = propertyPrice;
		this.carNumber = carNumber;
		this.carRentPrice = carRentPrice;
		this.carSellPrice = carSellPrice;
		this.setPropertyType(propertyType);
		
		this.createTime = createTime;
		this.status = status;
		this.lastUpdateTime = lastUpdateTime;
		this.developStatus = developStatus;
	}
	
	public Building(Integer buildingId, String name, String propertyCompany, String propertyPrice,
			Integer carNumber, String carRentPrice, String carSellPrice, String status, Date lastUpdateTime,
			Integer developStatus, PropertyType propertyType) {
		this.buildingId = buildingId;
		this.name = name;
		this.propertyCompany = propertyCompany;
		this.propertyPrice = propertyPrice;
		this.carNumber = carNumber;
		this.carRentPrice = carRentPrice;
		this.carSellPrice = carSellPrice;
		this.setPropertyType(propertyType);
		
		this.status = status;
		this.lastUpdateTime = lastUpdateTime;
		this.developStatus = developStatus;
	}
	
	public Building(Integer buildingId, String name, String propertyCompany, String propertyPrice,
			Integer carNumber, String carRentPrice, String carSellPrice, String status, Date lastUpdateTime,
			PropertyType propertyType) {
		this.buildingId = buildingId;
		this.name = name;
		this.propertyCompany = propertyCompany;
		this.propertyPrice = propertyPrice;
		this.carNumber = carNumber;
		this.carRentPrice = carRentPrice;
		this.carSellPrice = carSellPrice;
		this.setPropertyType(propertyType);
		
		this.status = status;
		this.lastUpdateTime = lastUpdateTime;
	}
	
	public Building(Integer buildingId, String name, String propertyCompany, String propertyPrice,
			Integer carNumber, String carRentPrice, String carSellPrice, String status,
			PropertyType propertyType) {
		this.buildingId = buildingId;
		this.name = name;
		this.propertyCompany = propertyCompany;
		this.propertyPrice = propertyPrice;
		this.carNumber = carNumber;
		this.carRentPrice = carRentPrice;
		this.carSellPrice = carSellPrice;
		this.setPropertyType(propertyType);
		
		this.status = status;
	}
	
	public Building(Integer buildingId, String name, String propertyCompany, String propertyPrice,
			Integer carNumber, String carRentPrice, String carSellPrice,
			PropertyType propertyType) {
		this.buildingId = buildingId;
		this.name = name;
		this.propertyCompany = propertyCompany;
		this.propertyPrice = propertyPrice;
		this.carNumber = carNumber;
		this.carRentPrice = carRentPrice;
		this.carSellPrice = carSellPrice;
		this.setPropertyType(propertyType);
	}
	
	public Building(Integer buildingId, String name, String propertyCompany, String propertyPrice,
			Integer carNumber, String carRentPrice, String carSellPrice,
			Integer propertyTypeId) {
		this.buildingId = buildingId;
		this.name = name;
		this.propertyCompany = propertyCompany;
		this.propertyPrice = propertyPrice;
		this.carNumber = carNumber;
		this.carRentPrice = carRentPrice;
		this.carSellPrice = carSellPrice;
		this.propertyTypeId = propertyTypeId;
	}
	
	public Building(Integer buildingId, String name, String propertyCompany, String propertyPrice,
			Integer carNumber, String carRentPrice, String carSellPrice) {
		this.buildingId = buildingId;
		this.name = name;
		this.propertyCompany = propertyCompany;
		this.propertyPrice = propertyPrice;
		this.carNumber = carNumber;
		this.carRentPrice = carRentPrice;
		this.carSellPrice = carSellPrice;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "buildingId", unique = true, nullable = false, insertable = true, updatable = true)
	public Integer getBuildingId() {
		return this.buildingId;
	}

	public void setBuildingId(Integer buildingId) {
		this.buildingId = buildingId;
	}
	@JsonIgnore
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "propertyTypeId", unique = false, nullable = true, insertable = true, updatable = true)
	public PropertyType getPropertyType() {
		return this.propertyType;
	}

	public void setPropertyType(PropertyType propertyType) {
		if (null != propertyType) {
			this.setPropertyTypeId(propertyType.getPropertyTypeId());
		}
		this.propertyType = propertyType;
	}

	@JsonIgnore
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "areaId", unique = false, nullable = true, insertable = true, updatable = true)
	public Area getArea() {
		return this.area;
	}

	public void setArea(Area area) {
		if (null != area) {
			this.setAreaId(area.getAreaId());
		} else {
			this.setAreaId(null);
		}
		this.area = area;
	}

	@Column(name = "name", unique = true, nullable = false, insertable = true, updatable = true, length = 64)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}
	@JsonIgnore
	@Column(name = "status", unique = false, nullable = false, insertable = true, updatable = true, length = 12)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	@JsonIgnore
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "createTime", unique = false, nullable = false, insertable = true, updatable = true, length = 19)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@JsonIgnore
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "lastUpdateTime", unique = false, nullable = false, insertable = true, updatable = true, length = 19)
	public Date getLastUpdateTime() {
		return this.lastUpdateTime;
	}
	@JsonIgnore
	public void setLastUpdateTime(Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}
	@JsonIgnore
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "publishTime", unique = false, nullable = true, insertable = true, updatable = true, length = 19)
	public Date getPublishTime() {
		return this.publishTime;
	}
	
	public void setPublishTime(Date publishTime) {
		this.publishTime = publishTime;
	}
	@JsonIgnore
	@Column(name = "developStatus", unique = false, nullable = false, insertable = true, updatable = true)
	public Integer getDevelopStatus() {
		return this.developStatus;
	}

	public void setDevelopStatus(Integer developStatus) {
		this.developStatus = developStatus;
	}
	@JsonIgnore
	@Column(name = "developer", unique = false, nullable = true, insertable = true, updatable = true, length = 64)
	public String getDeveloper() {
		return this.developer;
	}

	public void setDeveloper(String developer) {
		this.developer = developer;
	}

	@Column(name = "address", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	@JsonIgnore
	@Column(name = "mapInfo", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public String getMapInfo() {
		return this.mapInfo;
	}

	public void setMapInfo(String mapInfo) {
		this.mapInfo = mapInfo;
	}
	@JsonIgnore
	@Column(name = "advantage", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public String getAdvantage() {
		return this.advantage;
	}

	public void setAdvantage(String advantage) {
		this.advantage = advantage;
	}
	@JsonIgnore
	@Column(name = "intro", unique = false, nullable = true, insertable = true, updatable = true, length = 2000)
	public String getIntro() {
		return this.intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}
	@JsonIgnore
	@Column(name = "space", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Double getSpace() {
		return this.space;
	}
	
	public void setSpace(Double space) {
		this.space = space;
	}
	@JsonIgnore
	@Column(name = "buildStructure", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public String getBuildStructure() {
		return this.buildStructure;
	}

	public void setBuildStructure(String buildStructure) {
		this.buildStructure = buildStructure;
	}
	@JsonIgnore
	@Column(name = "yearLimit", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Double getYearLimit() {
		return this.yearLimit;
	}

	public void setYearLimit(Double yearLimit) {
		this.yearLimit = yearLimit;
	}
	@JsonIgnore
	@Column(name = "afforest", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Double getAfforest() {
		return this.afforest;
	}

	public void setAfforest(Double afforest) {
		this.afforest = afforest;
	}
	@JsonIgnore
	@Column(name = "cubage", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Double getCubage() {
		return this.cubage;
	}

	public void setCubage(Double cubage) {
		this.cubage = cubage;
	}
	@JsonIgnore
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "beginDate", unique = false, nullable = true, insertable = true, updatable = true, length = 19)
	public Date getBeginDate() {
		return this.beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	@JsonIgnore
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "finishDate", unique = false, nullable = true, insertable = true, updatable = true, length = 19)
	public Date getFinishDate() {
		return this.finishDate;
	}

	public void setFinishDate(Date finishDate) {
		this.finishDate = finishDate;
	}
	@JsonIgnore
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "sellDate", unique = false, nullable = true, insertable = true, updatable = true, length = 19)
	public Date getSellDate() {
		return this.sellDate;
	}
	
	public void setSellDate(Date sellDate) {
		this.sellDate = sellDate;
	}
	@JsonIgnore
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "occupancyDate", unique = false, nullable = true, insertable = true, updatable = true, length = 19)
	public Date getOccupancyDate() {
		return this.occupancyDate;
	}
	
	public void setOccupancyDate(Date occupancyDate) {
		this.occupancyDate = occupancyDate;
	}
	@JsonIgnore
	@Column(name = "trafficInfo", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public String getTrafficInfo() {
		return this.trafficInfo;
	}
	
	public void setTrafficInfo(String trafficInfo) {
		this.trafficInfo = trafficInfo;
	}
	@JsonIgnore
	@Column(name = "floorInfo", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public String getFloorInfo() {
		return this.floorInfo;
	}
	
	public void setFloorInfo(String floorInfo) {
		this.floorInfo = floorInfo;
	}
	@JsonIgnore
	@Column(name = "deliverStandar", unique = false, nullable = true, insertable = true, updatable = true, length = 64)
	public String getDeliverStandar() {
		return this.deliverStandar;
	}

	public void setDeliverStandar(String deliverStandar) {
		this.deliverStandar = deliverStandar;
	}
	@JsonIgnore
	@Column(name = "recommend", unique = false, nullable = true, insertable = true, updatable = true)
	public Integer getRecommend() {
		return this.recommend;
	}

	public void setRecommend(Integer recommend) {
		this.recommend = recommend;
	}
	@JsonIgnore
	@Column(name = "propertyCompany", unique = false, nullable = true, insertable = true, updatable = true, length = 128)
	public String getPropertyCompany() {
		return this.propertyCompany;
	}

	public void setPropertyCompany(String propertyCompany) {
		this.propertyCompany = propertyCompany;
	}
	@JsonIgnore
	@Column(name = "propertyPrice", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public String getPropertyPrice() {
		return this.propertyPrice;
	}

	public void setPropertyPrice(String propertyPrice) {
		this.propertyPrice = propertyPrice;
	}
	@JsonIgnore
	@Column(name = "planSpace", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Double getPlanSpace() {
		return this.planSpace;
	}

	public void setPlanSpace(Double planSpace) {
		this.planSpace = planSpace;
	}
	@JsonIgnore
	@Column(name = "carNumber", unique = false, nullable = true, insertable = true, updatable = true)
	public Integer getCarNumber() {
		return this.carNumber;
	}

	public void setCarNumber(Integer carNumber) {
		this.carNumber = carNumber;
	}
	@JsonIgnore
	@Column(name = "carRentPrice", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public String getCarRentPrice() {
		return this.carRentPrice;
	}

	public void setCarRentPrice(String carRentPrice) {
		this.carRentPrice = carRentPrice;
	}
	@JsonIgnore
	@Column(name = "carSellPrice", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public String getCarSellPrice() {
		return this.carSellPrice;
	}

	public void setCarSellPrice(String carSellPrice) {
		this.carSellPrice = carSellPrice;
	}
	@JsonIgnore
	@Column(name = "sellSchedule", unique = false, nullable = true, insertable = true, updatable = true)
	public Integer getSellSchedule() {
		return this.sellSchedule;
	}

	public void setSellSchedule(Integer sellSchedule) {
		this.sellSchedule = sellSchedule;
	}
	@JsonIgnore
	@Column(name = "effectImg", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getEffectImg() {
		return this.effectImg;
	}

	public void setEffectImg(String effectImg) {
		this.effectImg = effectImg;
	}
	@JsonIgnore
	@Column(name = "actionImg", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getActionImg() {
		return this.actionImg;
	}

	public void setActionImg(String actionImg) {
		this.actionImg = actionImg;
	}
	@JsonIgnore
	@Column(name = "trafficImg", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getTrafficImg() {
		return this.trafficImg;
	}

	public void setTrafficImg(String trafficImg) {
		this.trafficImg = trafficImg;
	}
	@JsonIgnore
	@Column(name = "planImg", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getPlanImg() {
		return this.planImg;
	}

	public void setPlanImg(String planImg) {
		this.planImg = planImg;
	}
	@JsonIgnore
	@Column(name = "sellAddress", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getSellAddress() {
		return this.sellAddress;
	}

	public void setSellAddress(String sellAddress) {
		this.sellAddress = sellAddress;
	}
	@JsonIgnore
	@Column(name = "linkMan", unique = false, nullable = true, insertable = true, updatable = true, length = 64)
	public String getLinkMan() {
		return this.linkMan;
	}

	public void setLinkMan(String linkMan) {
		this.linkMan = linkMan;
	}
	@JsonIgnore
	@Column(name = "mobile", unique = false, nullable = true, insertable = true, updatable = true, length = 40)
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	@JsonIgnore
	@Column(name = "sellTel", unique = false, nullable = true, insertable = true, updatable = true, length = 40)
	public String getSellTel() {
		return this.sellTel;
	}

	public void setSellTel(String sellTel) {
		this.sellTel = sellTel;
	}
	@JsonIgnore
	@Column(name = "fax", unique = false, nullable = true, insertable = true, updatable = true, length = 40)
	public String getFax() {
		return this.fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}
	@JsonIgnore
	@Column(name = "hits", unique = false, nullable = true, insertable = true, updatable = true)
	public Integer getHits() {
		return this.hits;
	}

	public void setHits(Integer hits) {
		this.hits = hits;
	}
	@JsonIgnore
	@Column(name = "surround", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getSurround() {
		return this.surround;
	}

	public void setSurround(String surround) {
		this.surround = surround;
	}
	@JsonIgnore
	@Column(name = "administration", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getAdministration() {
		return this.administration;
	}

	public void setAdministration(String administration) {
		this.administration = administration;
	}
	@JsonIgnore
	@Column(name = "educate", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getEducate() {
		return this.educate;
	}

	public void setEducate(String educate) {
		this.educate = educate;
	}
	@JsonIgnore
	@Column(name = "trade", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getTrade() {
		return this.trade;
	}

	public void setTrade(String trade) {
		this.trade = trade;
	}
	@JsonIgnore
	@Column(name = "medical", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getMedical() {
		return this.medical;
	}

	public void setMedical(String medical) {
		this.medical = medical;
	}
	@JsonIgnore
	@Column(name = "financial", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getFinancial() {
		return this.financial;
	}

	public void setFinancial(String financial) {
		this.financial = financial;
	}
	@JsonIgnore
	@Column(name = "repast", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getRepast() {
		return this.repast;
	}

	public void setRepast(String repast) {
		this.repast = repast;
	}
	@JsonIgnore
	@Column(name = "other", unique = false, nullable = true, insertable = true, updatable = true, length = 512)
	public String getOther() {
		return this.other;
	}

	public void setOther(String other) {
		this.other = other;
	}
	@JsonIgnore
	@Transient
	public Integer getPropertyTypeId() {
		return propertyTypeId;
	}

	public void setPropertyTypeId(Integer propertyTypeId) {
		this.propertyTypeId = propertyTypeId;
	}
	@JsonIgnore
	@Transient
	public Integer getAreaId() {
		return areaId;
	}
	
	public void setAreaId(Integer areaId) {
		this.areaId = areaId;
	}

	/*
	 * @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY,
	 * mappedBy = "building") public Set<BuildingPrice> getBuildingPrices() {
	 * return this.buildingPrices; }
	 * 
	 * public void setBuildingPrices(Set<BuildingPrice> buildingPrices) {
	 * this.buildingPrices = buildingPrices; }
	 */
	@JsonManagedReference
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "building")
	public Set<House> getHouses() {
		return this.houses;
	}

	public void setHouses(Set<House> houses) {
		this.houses = houses;
	}

	public void setPictures(List<UploadFile> pictures) {
		this.pictures = pictures;
	}
	@JsonIgnore
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "building")
	@Where(clause="objType = \"building\" and extension != \"swf\"")
	public List<UploadFile> getPictures() {
		return pictures;
	}
	
	@JsonIgnore
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "building")
	@Where(clause="objType = \"building\" and extension = \"swf\"")
	public List<UploadFile> getVideos() {
		return videos;
	}

	public void setVideos(List<UploadFile> videos) {
		this.videos = videos;
	}

	@JsonIgnore
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "building")
	@Where(clause="objType = \"building\"")
	public List<AuditHistory> getAuditHistory() {
		return auditHistory;
	}

	public void setAuditHistory(List<AuditHistory> auditHistory) {
		this.auditHistory = auditHistory;
	}
	@JsonIgnore
	@Transient
	public Integer getMetroId() {
		return metroId;
	}
	@JsonIgnore
	@Transient
	public Integer getStationId() {
		return stationId;
	}

	public void setStationId(Integer stationId) {
		this.stationId = stationId;
	}

	public void setMetroId(Integer metroId) {
		this.metroId = metroId;
	}
	@JsonIgnore
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "stationId", unique = false, nullable = true, insertable = true, updatable = true)
	public MetroStation getMetroStation() {
		return metroStation;
	}

	public void setMetroStation(MetroStation metroStation) {
		if (null != metroStation) {
			this.setStationId(metroStation.getStationId());
			if (null != metroStation.getMetroByMetroId()) {
				this.setMetroId(metroStation.getMetroByMetroId().getMetroId());
			} else if (null != metroStation.getMetroByMetroId1()) {
				this.setMetroId(metroStation.getMetroByMetroId1().getMetroId());
			} else {
				this.setMetroId(null);
			}
		} else {
			this.setStationId(null);
		}
		this.metroStation = metroStation;
	}

	@Transient
	public Integer getRent() {
		return rent;
	}

	public void setRent(Integer rent) {
		this.rent = rent;
	}

	@Transient
	public Integer getSale() {
		return sale;
	}

	public void setSale(Integer sale) {
		this.sale = sale;
	}
	
	@Column(name = "lng", scale=6,unique = true, nullable = true, insertable = true, updatable = true)
	public Double getLng() {
		return lng;
	}

	public void setLng(Double lng) {
		this.lng = lng;
	}
	@Column(name = "lat", scale=6,unique = true, nullable = true, insertable = true, updatable = true)
	public Double getLat() {
		return lat;
	}

	public void setLat(Double lat) {
		this.lat = lat;
	}

	public void setAvgSale(Double avgSale) {
		this.avgSale = avgSale;
	}

	@Transient
	public Double getAvgSale() {
		return avgSale;
	}

	public void setAvgRent(Double avgRent) {
		this.avgRent = avgRent;
	}

	@Transient
	public Double getAvgRent() {
		return avgRent;
	}
}